/*
programs from NLA testsuite with seeded bugs
*/




void euclidex2_bug_dummy(int a, int b,int y,int r,int x,int p,int q, int s){}
int euclidex2_bug(int x, int y){
  int a,b,p,q,r,s;
    
  a=x;
  b=y;
  p=1;
  q=0;
  r=0;
  s=1;
  
  printf("a b y r x p q s\n");
  
  while(a!=b) { 
    if (get_n_incr_loop_ctr_tracker() >= MAX_LOOP){break;}
    //expected
    //a = yr + xp
    //b = xq + ys

    //obtained
    //0: b*rvu + a - x == 0
    //0: y*j + x - A == 0

    printf("%d %d %d %d %d %d %d %d\n",a,b,y,r,x,p,q,s);
    euclidex2_bug_dummy(a,b,y,r,x,p,q,s);
    

    if (a>b){
      a = a+b; //bug: should be a = a - b
      p = p-q; 
      r = r-s;
    }
    else {
      b = b-a; 
      q = q-p; 
      s = s-r;
    }
  }

  return a;
}//euclidex2


